<?php
/**
 * Created by PhpStorm.
 * User: dongdm
 * Date: 2018/9/25
 * Time: 下午3:48
 */


/**
 * 入口文件
 */
define('PLLX',realpath('./'));
define('CORE',PLLX.'/core');
define('APP',PLLX.'/app');
define('DEBUG',ture);
define('MODUEl','app');
require 'vendor/autoload.php';


use Monolog\Logger;
use Monolog\Handler\StreamHandler;

// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('runtime/log/log.log', Logger::WARNING));

// add records to the log
//$log->warning('Foo');
//$log->error('Bar');

if (DEBUG){
    $whoops = new \Whoops\Run;
    $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
    $whoops->register();
    ini_set('display_errors','On');
}else{
    ini_set('display_errors','Off');
}

//在加载函数库
include CORE.'/common/function.php';
//加载核心文件
include CORE.'/pllx.php';
//p(PLLX);

spl_autoload_register('\core\pllx::load');
//启动框架
\core\pllx::run();